<template>
    <div class="lineMain2" id="lineChartMain2" style="width:100%;margin-top: -50px;"></div>
</template>
<script>
export default {
    data() {
        return {
        }
    },
    methods: {
        lineChart2() {
            var chartDom = document.getElementById('lineChartMain2');
            var myChart = this.$echarts.init(chartDom);
            var option;
            option = {
                // title: {
                //     // text: '承保企业数占比',
                //     // left: 'center',
                //     textStyle: {
                //         color: '#AAAAAA',
                //         fontSize: 12
                //     },
                // },
                tooltip: {
                    trigger: 'axis',
                    // trigger: 'item',
                    textStyle: {
                        color: '#AAAAAA',
                        fontSize: 12
                    },
                },
                legend: {
                    bottom: 'bottom',
                    // type: 'scroll',
                    // left: 20,
                    // itemWidth: 10,
                    // icon: 'circle',
                    // type: 'scroll',
                    // pageButtonPosition: 'end',
                    // pageIconColor: '#3ba1ff',
                    // pageIconInactiveColor: '#7f7f7f',
                    // pageIconSize: 10,
                    textStyle: {
                        color: '#AAAAAA',
                        fontSize: 10
                    },
                    data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
                },
                grid: {
                    left: '3%',
                    right: '5%',
                    bottom: '10%',
                    containLabel: true
                },
                // toolbox: {
                //     feature: {
                //         saveAsImage: {}
                //     }
                // },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        name: 'Email',
                        type: 'line',
                        stack: 'Total',
                        data: [120, 132, 101, 134, 90, 230, 210]
                    },
                    {
                        name: 'Union Ads',
                        type: 'line',
                        stack: 'Total',
                        data: [220, 182, 191, 234, 290, 330, 310]
                    },
                    {
                        name: 'Video Ads',
                        type: 'line',
                        stack: 'Total',
                        data: [150, 232, 201, 154, 190, 330, 410]
                    },
                    {
                        name: 'Direct',
                        type: 'line',
                        stack: 'Total',
                        data: [320, 332, 301, 334, 390, 330, 320]
                    },
                    {
                        name: 'Search Engine',
                        type: 'line',
                        stack: 'Total',
                        data: [820, 932, 901, 934, 1290, 1330, 1320]
                    }
                ]
            };
            option && myChart.setOption(option);
            window.addEventListener("resize", function () {
                myChart.resize();

            });
        },
    },
    computed: {
    },
    mounted() {
        this.lineChart2();
    }
}
</script>
<style scoped>
#lineChartMain2 {
    width: 100%;
    height: 460px;
    /* z-index: 999; */
}
</style>